#ifndef __remote_Rx_H
#define __remote_Rx_H

#include "main.h"

typedef struct
{
	uint8_t header[2];
	uint8_t End[2];
}ArrTE_typedef;

typedef struct 
{
	uint8_t Rx_res;
	uint8_t Rx_Arr[20];
	uint8_t Rx_Arr_Cache[20];
	uint8_t Rx_Position;
	uint8_t Rx_Flag;
	uint16_t remote_tick;
	
	uint8_t button_Sum;
	uint8_t NoResButton[4];
//	uint8_t button[8];
	uint8_t other_data[4];//其他信息
	
	float Left_X;
	float Left_Y;
	float Right_X;
	float Right_Y;
	
	float Remote_safeNumber;//安全阈值
	
	float Left_Angle;
	float Right_Angle;
	
	ArrTE_typedef ArrTE;
}Remote_Rx_typedef;

extern Remote_Rx_typedef Remote_Rx;

void Remote_UART_Receive_IT_Init(Remote_Rx_typedef *Remote_t);
void Remote_UART_DMA_Init(Remote_Rx_typedef *Remote_t);
void Remote_UART_analysis(Remote_Rx_typedef *Remote_t,uint8_t res);
void Remote_RxArr_Analysis(Remote_Rx_typedef *Remote_t);
#endif